<template>
	<view class="up_data">
		<view class="auto_box" v-if="dati == true">
			<view class="up_img_box">
				<image class="w100 h100" src="../pages/filePages/static/updata.png" mode=""></image>
			</view>
			<view class="tijiao family s32 f500 txtali">
				{{ data }}
			</view>
			<view class="tijiao_c family s26 f500 txtali">
				{{ minTxt }}
			</view>
			<view class="fanhui_btn s28 family f500 txtali" @click="Back">返回</view>
		</view>
		<view class="ylauto_box" v-if="dati == false">
			<view class="ylup_img_box">
				<image src="../pages/filePages/static/Frame.png" mode=""></image>
			</view>
			<view class="ylend family s32 f500 txtali">
				{{ data }}
			</view>
			<view class="yltxt family s32 f500 txtali">
				{{ minTxt }}
			</view>
			<view class="ylbot s32 family f500 txtali" @click="Back">
				{{ flag == 'c4' ? '返回' : '去答题' }}
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'upData',
	props: {
		data: {
			default: '',
			type: String
		},
		minTxt: {
			default: '',
			type: String
		},
		url: {
			default: '',
			type: String
		},
		flag: {
			default: 'c1',
			type: String
		},
		step: {
			default: 1,
			type: Number
		}
	},
	data() {
		return {
			dati: true
		};
	},
	methods: {
		Back() {
			if (this.flag == 'c1') {
				uni.navigateBack({
					delta: this.step
				});
			} else if (this.flag == 'c2') {
				this.dati = false;
			} else if (this.flag == 'c3') {
				uni.navigateTo({
					url: this.url
				});
			} else if (this.flag == 'c4') {
				uni.navigateBack({
					delta: this.step
				});
			}
		}
	}
};
</script>

<style scoped lang="scss">
.up_data {
	.auto_box {
		width: 342upx;
		height: 260upx;
		margin: 50% auto;
		.up_img_box {
			width: 128upx;
			height: 128upx;
			margin: 0 auto;
		}
		.tijiao {
			color: #844902;
			margin-top: 28upx;
		}
		.tijiao_c {
			color: #999999;
			margin-top: 32upx;
		}
		.fanhui_btn {
			width: 218upx;
			height: 80upx;
			border-radius: 50upx 50upx 50upx 50upx;
			border: 2upx solid #ebbe87;
			margin: 114upx auto;
			line-height: 80upx;
			color: #ebbe87;
		}
	}
	.ylauto_box {
		width: 370upx;
		height: 260upx;
		margin: 50% auto;
		.ylup_img_box {
			width: 128upx;
			height: 128upx;
			margin: 0 auto;
			background-color: #ebbe87;
			border-radius: 50%;
			padding: 30upx;
			box-sizing: border-box;
			image {
				width: 68upx;
				height: 68upx;
			}
		}
		.ylend {
			color: #844902;
			margin-top: 36upx;
		}
		.yltxt {
			color: #333333;
			margin-top: 108upx;
		}
		.ylbot {
			width: 218upx;
			height: 80upx;
			border-radius: 50upx 50upx 50upx 50upx;
			margin: 110upx auto;
			line-height: 80upx;
			color: white;
			background-color: #ebbe87;
		}
	}
}
</style>
